<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>dom</title>
    <script>
        window.onload=function(){
           
        var y=document.getElementById('gu');
        console.log(y);
    }
    
    </script>
    <style>
    
    </style>
</head>
<body>
    <section>

        <div id="gu">
            <p id="good">我是</p>
            <p class="class">我是1</p>
            <p>我是</p>
            <p>我是</p>
            <p>我是</p>
        </div>
    </section>
    <script>
         var x=document.getElementsByClassName('class');
             console.log(x);
             var n=document.getElementsByName('p');
             console.log(n);
             var e=document.querySelector('.class');
             console.log(e);
             var r=document.querySelectorAll('p');
             console.log(r[1]);
             
    </script>
</body>
</html>